<!-- -->
<script type="text/javascript">
	function deletePost(url_execute){
		if(confirm("Are you sure you want to delete this attachement?")){
			document.forms[0].action=url_execute;
			document.forms[0].submit();
		}else{
			return false;
		}
	}	
</script>
<div id="border"> 
<form action="<?=base_url();?>index.php/job_wanted/update_job" enctype="multipart/form-data" method="post">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
   <tr>
   <td valign="top">       
      <table width="99%" border="0" align="center" id="usertitle">
        <tr>
          <td><h3><b>Update job wanted<b></h3></td>
          <td align="right">
                  
          </td>
        </tr>
      </table>
     <div id="content">
     <div class="user_line_border_top"></div> 

     <table width="88%" align="center" cellpadding="0" cellspacing="0" style="margin-top:30px;">
          <!-- coun = 0 show upload file again -->
          <tr>
              <td width="27%">
                <label for="name"><b>Subject</b>  &nbsp;</label>
                <input type="hidden" name="txtjid" value="<?=$job_id?>" />
             </td>
         <tr>
         	<td colspan="2">
            	<input name="txtsub" type="text" value="<?=$selectupload[0]->job_wan_subject?>" style="width:600px">
            </td>
         </tr>
         <tr>
         	<td height="26" colspan="2" valign="bottom">
            	<label for="message"><b>Your Description</b></label>
            </td>
         </tr>
         <tr>
         	<td colspan="2">
            	<textarea name="txtdes" rows="26" style="width:600px"><?=$selectupload[0]->job_wan_desc?></textarea>
            </td>
         </tr>
           	
           	<!--End coun = 0 show upload file again -->
              <tr>
                 <td colspan="2" align="left" style="padding-right: 15px;">
                 
				 <?php 
				    $file_exist = false;
					if ($selectimage->num_rows() > 0) {
						echo "<h4>Attachement files</h4>";
					}
				    foreach ($selectimage->result() as $rowselect){ ?>
					
              		<?php 
					$file_exist = true;
					$fullname=$rowselect->file_name;
    				$shortname=(strlen($fullname)>20)?substr($fullname,0,20)."...":substr($fullname,0,20); ?>
                    <div class="file_ext">
						<? $file_ext = next(explode(".", $shortname));
                            if($file_ext=="docx" || $file_ext=="doc"){?>
                            <img src="<?=base_url()?>images/doc.png" width="16" height="16" align="left" />
                        <? }elseif($file_ext=="pdf"){?>
                            <img src="<?=base_url()?>images/pdf.png" width="16" height="16" align="left" />
                        <? }?>
                        &nbsp; <?=$shortname?> <img src="<?=base_url()?>images/del.jpg" style="cursor: pointer;" align="center" onclick='javascript:deletePost("<?=base_url();?>index.php/job_wanted/delete_file/<?=$job_id?>/<?=$rowselect->file_id?>")'/><br />	
                     </div>
                 <?php }?>
                 </td>            	              	
                   
              </tr>
              <tr>
           			<td colspan="2">
                    <h4>
                    <?=($file_exist?"Upload more attachements":"Upload new attachements")?>
                    </h4>
                    <div style="color:#999;">Image format: Jpeg, Jpg, Gif,  Png, doc, docx or pfd Size: 3MB<br />
                    </div>  
            	 	<input type="file" name="image1" /><br />
             		<input type="file" name="image2" /><br />
             		<input type="file" name="image3" /><br />
             		<input type="file" name="image4" /><br />
             		<input type="file" name="image5" /><br /> 
           			</td>
           		</tr>
                    
             <tr><td height="68" colspan="2"><input type="button" value="Back" class="btn_search_pro" onclick="document.location='<?=$_SERVER['HTTP_REFERER']?>'" /> <input type="submit" class="kh_button" value="Ready update" name="go" style="background:#BD2031; width:106px; height:24px; color:#fff; border:0;-webkit-border-radius: 3px;-moz-border-radius: 3px;border-radius: 3px; cursor:pointer;" /></td></tr>
            </table>
      
  	</div>  
    </td>
    <td width="254" valign="top"><?php include APPPATH."views/templates/common/right_content.php"; ?></td>
       
    </tr>
</table>

</form><br />    
</div>